package com.chapter.sample;

import com.chapter.sample.toolkit.cache.annotation.EnableRedisson;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * -Xlog:gc* -XX:MetaspaceSize=64m -Xss512k -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Library/dev/sample/chapter-common-platform/chapter-common-sample/heap/heapdump.hprof -XX:SurvivorRatio=8 -XX:+TraceClassLoading -Xms1G -Xmx1G -Xloggc:/Library/dev/sample/chapter-common-platform/chapter-common-sample/log/gc.log -XX:+UseParallelGC
 */
//@MapperScan("com.chapter.sample.dao")
@EnableAspectJAutoProxy
@SpringBootApplication
@EnableRedisson
public class Application {

    @Resource
    private ThreadPoolTaskExecutor threadPool;

    @PostConstruct
    public void getTheadPoolConfig() {
        System.out.println("**************测试threadPool getCorePoolSize： " + threadPool.getCorePoolSize());
        System.out.println("**************测试threadPool getMaxPoolSize： " + threadPool.getMaxPoolSize());
        System.out.println("**************测试threadPool getQueueCapacity： " + threadPool.getQueueCapacity());
        System.out.println("**************测试threadPool getKeepAliveSeconds： " + threadPool.getKeepAliveSeconds());
    }

    public static void main(String[] args) {
        System.out.println("Hello world!");
        System.out.println(Runtime.getRuntime().availableProcessors());
        SpringApplication.run(Application.class, args);
    }
}
